//
//  QuanlityBannerViewController.m
//  MyProject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "QuanlityBannerViewController.h"
#import <MBProgressHUD.h>
@interface QuanlityBannerViewController ()<UIWebViewDelegate>
{
    MBProgressHUD *hud;
}

@end

@implementation QuanlityBannerViewController
- (void)viewWillAppear:(BOOL)animated
{
 
    self.tabBarController.tabBar.hidden = YES;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = self.banner.title;
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height + 49)];
    webView.exclusiveTouch = NO;
    webView.delegate = self;
    
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:self.banner.extend]];
    
    [self.view addSubview: webView];
    
    [webView loadRequest:request];
    
    
    
    
    //    回弹效果
    [(UIScrollView *)[[webView subviews] objectAtIndex:0] setBounces:NO];
    //    隐藏滑动条
    webView.scrollView.showsVerticalScrollIndicator = NO;
    

    
    
}


- (void)webViewDidStartLoad:(UIWebView *)webView
{
    hud = [[MBProgressHUD alloc]initWithFrame:self.view.bounds];
    [self.view addSubview:hud];
    [hud show:YES];
    hud.detailsLabelText = @"加载中...";
    
    
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    hud.hidden = YES;
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
